from tkinter import *
#   2021-06-12  19:45
# https://coderslegacy.com/python/python-gui/python-tkinter-frame/
root = Tk()
root.geometry("200x150")
frame = Frame(root,bd = 3,bg = "blue")  # bd-> border size
frame.pack()    #   装载Frame

leftframe = Frame(root,bd =5,bg = "purple")
leftframe.pack(side = LEFT)

rightframe = Frame(root,bd = 25 ,bg = "red")    #   可以发现增大这里的bd数值，框也会变大。  
rightframe.pack(side = RIGHT)

label = Label(frame,text = "Hello world")
label.pack()

button1 = Button(leftframe,text = "Button1")    #   将Button1映射到Frame
button1.pack(padx=3,pady = 3)

button2 = Button(rightframe,text="Button2")
button2.pack(padx=3,pady=3)

button3 = Button(leftframe,text = "Button3")    #   将Button3映射到Frame
button3.pack(padx=3,pady = 3)

root.title("Test")
root.mainloop()
